import axios from '@/utils/http';
import base from './base';

export default {
  // 获取未读消息数量
  count() {
    return axios.get(
      `${base.sq}/messages/count`,
    );
  },
  // 获取未读消息列表
  index(params) {
    return axios.get(
      `${base.sq}/messages`,
      {
        params: {
          message_type: params.type,
          is_read: params.read,
          page: params.page,
        },
      },
    );
  },
  // 标记为已读
  read(params) {
    return axios.post(
      `${base.sq}/messages/read`,
      {
        ids: params.notesId,
        is_read: params.read,
      },
    );
  },
};
